home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PD Collection CD 1
/
PD Collection CD 1.iso
/
programer2
/
euclidlib
/
h
/
cache
< prev
next >
Wrap
Text File
|
1992-04-16
|
2KB
|
58 lines
/**** cache.h ****/
/* Routines that allow multitasking pictures to use a single cache.
* By Paul Field
* See !ReadMe file for distribution/modification restrictions
*
* For the purposes of these routines you can treat a euclid structure as a cache
* - useful when you want several multitasking pictures of one structure that
* does not use a drawing cache
*
* 'Cache' may well be replaced with a more general 'process' module in a later
* version of the library.
*/
#ifndef __cache_h
#define __cache_h
#include "bool.h"
#include "euclid.h"
typedef void (*cache_processstart) (void *cache, void *handle);
BOOL cache_callwhenfree(void *cache, cache_processstart, void *handle);
/* Registers a routine to be called when 'cache' is no longer being used.
* This routine should start a process which is always terminated with a
* call to 'cache_finished'.
* Routines are called on a first come, first served basis.
* Returns FALSE if the routine could not be registered.
* N.B. The function that you pass will be called immediately if the cache is
* free, so make sure you set up any flags or data it might need BEFORE
* you make this call.
*/
void cache_finished(void *cache);
/* This routine should be called when the cache is no longer needed and can be
* used by a new process.
*/
void cache_removeprocess(void *cache, cache_processstart, void *handle);
/* Removes any pending calls to a process that is started by 'cache_processstart'
* with 'handle'. (If there is more than one call pending then they will all be removed)
* N.B. This does not affect the currently running process.
*/
void cache_removeallprocesses(void *cache, void *handle);
/* Removes all pending calls to processes that use 'handle' from the cache's pending
* call list.
*/
BOOL cache_inuse(void *cache);
/* Returns TRUE if the cache is being used at the current time.
*/
void *cache_address(euclid_header *structure);
/* Returns the value of the structure's cache (equals structure if it has no explicit
* drawing cache).
*/
#endif